<template>
	<view>
		<view class="contain">
			<view class="" style="display: flex;justify-content: center;margin-top: 50rpx;">
				<image style="width: 250rpx;border-radius: 50%;"  src="../../static/uni.png" mode="widthFix"></image>
			</view>
			<view class="" style="margin: 30px;">
				<uni-forms :modelValue="formData">
							<uni-forms-item label="账号" name="name">
								<uni-easyinput type="text" v-model="formData.username" placeholder="请输入账号" />
							</uni-forms-item>
							<uni-forms-item label="手机号" name="name">
								<uni-easyinput type="text" v-model="formData.phonenumber" placeholder="请输入手机号" />
							</uni-forms-item>
							<uni-forms-item label="密码" name="password">
								<uni-easyinput type="password" v-model="formData.password" placeholder="请输入密码" />
							</uni-forms-item>
							
				</uni-forms>
				<button @click="region" style="background-color: aqua;">注册</button>
			</view>
		</view>
		
	</view>
</template>

<script>
	import * as request from '@/unitl.js'
	export default {
		data() {
			return {
				formData:{
					username:'',
					password:'',
					phonenumber:''
				}
				
			}
		},
		methods: {
			region(){
				const res=request.default.register(this.formData)
				uni.showToast({
					icon:"success",
					title:"注册成功",
					success() {
						uni.navigateTo({
							url:"/pages/login/login"
						})
					}
				})
			}
			
		}
	}
</script>

<style>

</style>
